import request from '@/utils/request';

// 查询广告位列表
export function listCompon(query: any){
  return request({
    url: '/component/list',
    method: 'get',
    params: query
  });
}

// 新增广告位
export function addComponent(data: any) {
  return request({
    url: '/component',
    method: 'post',
    data: data
  });
}

// 删除广告
export function delComponent(configId: string | number | Array<string | number>) {
  return request({
    url: '/component/' + configId,
    method: 'delete'
  });
}

// 启用禁用
export function enableAdvert(id:string | number, params:any) {
  return request({
    url: `/component/enable/${id}`,
    method: 'PUT',
    params: params
  })
}

// 修改广告位配置
export function updateComponent(data: any) {
  return request({
    url: '/component',
    method: 'put',
    data: data
  });
}

